package org.jeecg.modules.oms.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Description: 财务统计VO - 应收应付模块
 * @Author: jeecg-boot
 * @Date: 2025-01-13
 * @Version: V1.0
 */
@Data
@ApiModel(value = "FinanceStatisticsVO", description = "财务统计数据VO - 应收应付模块")
public class FinanceStatisticsVO {

    /**
     * 趋势数据项
     */
    @Data
    @ApiModel(value = "TrendItem", description = "趋势数据项")
    public static class TrendItem {
        @ApiModelProperty(value = "日期")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
        private Date date;

        @ApiModelProperty(value = "数值")
        private BigDecimal value = BigDecimal.ZERO;

        @ApiModelProperty(value = "标签")
        private String label;

        @ApiModelProperty(value = "同比增长率")
        private BigDecimal growthRate = BigDecimal.ZERO;
    }


    /**
     * 账期分析项
     */
    @Data
    @ApiModel(value = "AgingItem", description = "账期分析项")
    public static class AgingItem {
        @ApiModelProperty(value = "账期范围")
        private String agingRange;

        @ApiModelProperty(value = "应收金额")
        private BigDecimal receivableAmount = BigDecimal.ZERO;

        @ApiModelProperty(value = "应付金额")
        private BigDecimal payableAmount = BigDecimal.ZERO;

        @ApiModelProperty(value = "应收占比")
        private BigDecimal receivablePercentage = BigDecimal.ZERO;

        @ApiModelProperty(value = "应付占比")
        private BigDecimal payablePercentage = BigDecimal.ZERO;
    }

    /**
     * 流动性分析项
     */
    @Data
    @ApiModel(value = "LiquidityItem", description = "流动性分析项")
    public static class LiquidityItem {
        @ApiModelProperty(value = "日期")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
        private Date date;

        @ApiModelProperty(value = "现金流入")
        private BigDecimal cashInflow = BigDecimal.ZERO;

        @ApiModelProperty(value = "现金流出")
        private BigDecimal cashOutflow = BigDecimal.ZERO;

        @ApiModelProperty(value = "净现金流")
        private BigDecimal netCashFlow = BigDecimal.ZERO;

        @ApiModelProperty(value = "累计现金流")
        private BigDecimal cumulativeCashFlow = BigDecimal.ZERO;
    }

    /**
     * 应收账款概览VO
     */
    @Data
    @ApiModel(value = "ReceivableOverviewVO", description = "应收账款概览VO")
    public static class ReceivableOverviewVO {
        @ApiModelProperty(value = "总应收金额")
        private BigDecimal totalReceivable = BigDecimal.ZERO;

        @ApiModelProperty(value = "已收金额")
        private BigDecimal totalReceived = BigDecimal.ZERO;

        @ApiModelProperty(value = "未收金额")
        private BigDecimal totalUnreceived = BigDecimal.ZERO;

        @ApiModelProperty(value = "回收率")
        private BigDecimal receivedRate = BigDecimal.ZERO;
    }

    /**
     * 应付账款概览VO
     */
    @Data
    @ApiModel(value = "PayableOverviewVO", description = "应付账款概览VO")
    public static class PayableOverviewVO {
        @ApiModelProperty(value = "总应付金额")
        private BigDecimal totalPayable = BigDecimal.ZERO;

        @ApiModelProperty(value = "已付金额")
        private BigDecimal totalPaid = BigDecimal.ZERO;

        @ApiModelProperty(value = "未付金额")
        private BigDecimal totalUnpaid = BigDecimal.ZERO;

        @ApiModelProperty(value = "支付率")
        private BigDecimal paidRate = BigDecimal.ZERO;
    }

}
